A Program Transformation for Backwards Analysis of Logic Programs
نویسنده
چکیده
The input to backwards analysis is a program together with properties that are required to hold at given program points. The purpose of the analysis is to derive initial goals or pre-conditions that guarantee that, when the program is executed, the given properties hold. The solution for logic programs presented here is based on a transformation of the input program, which makes explicit the dependencies of the given program points on the initial goals. The transformation is derived from the resultants semantics of logic programs. The transformed program is then analysed using a standard abstract interpretation. The required pre-conditions on initial goals can be deduced from the analysis results without a further fixpoint computation. For the modes backwards analysis problem, this approach gives the same results as previous work, but requires only a standard abstract interpretation framework and no special properties of the abstract domain.
منابع مشابه
Analysing Logic Programs by Reasoning Backwards
One recent advance in program development has been the application of abstract interpretation to verify the partial correctness of a (constraint) logic program. Traditionally forwards analysis has been applied that starts with an initial goal and traces the execution in the direction of the control-flow to approximate the program state at each program point. This is often enough to verify asser...
متن کاملInferring Termination Conditions for Logic Programs Using Backwards Analysis
This paper focuses on the inference of modes for which a logic program is guaranteed to terminate. This generalises traditional termination analysis where an analyser tries to verify termination for a specified mode. Our contribution is a methodology in which components of traditional termination analysis are combined with backwards analysis to obtain an analyser for termination inference. We i...
متن کاملHorn clauses as an intermediate representation for program analysis and transformation
Many recent analyses for conventional imperative programs begin by transforming programs into logic programs, capitalising on existing LP analyses and simple LP semantics. We propose using logic programs as an intermediate program representation throughout the compilation process. With restrictions ensuring determinism and single-modedness, a logic program can easily be transformed to machine l...
متن کاملAbstraction Refinement for Separation Logic Program Analyses
ion Refinement for Separation Logic Program Analyses Matko Botinčan, Mike Dodds, and Stephen Magill 1 University of Cambridge, {matko.botincan,mike.dodds}@cl.cam.ac.uk 2 [email protected] Abstract. Abstract domains based on separation logic allow the compositional analysis of heap-manipulating programs, and their effectiveness on real-world software has been extensively demonstrated. Tra...
متن کاملTowards a Logic for Reasoning About Logic Programs Transformation
We give a proof-theoretic analysis of logic programs transformations , viewed as operations on proof trees in the sense of 3, 4, 9, 10]. We present a logic for reasoning about (equivalence preserving) transformations of logic programs. Our main tool is the usage of inference rules; the target program may be obtained as a set of clause introduction proofs with axioms from the source program. The...
متن کامل